//
//  ChooseCollectionViewCell.m
//  NutritionUser
//
//  Created by Chendaobin on 2019/3/2.
//  Copyright © 2019年 Chendaobin. All rights reserved.
//

#import "ChooseCollectionViewCell.h"

@interface ChooseCollectionViewCell()
//@property (weak, nonatomic) IBOutlet UIButton *iconBut;
@property (weak, nonatomic) IBOutlet UIButton *DeleBut;

@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;


@end
@implementation ChooseCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.iconImageView.userInteractionEnabled = NO;
    self.DeleBut.imageEdgeInsets = UIEdgeInsetsMake(-8, 8, 0, 0);
    
  
    [self.DeleBut addTarget:self action:@selector(deleButTap:) forControlEvents:UIControlEventTouchUpInside];
    
}
-(void)setModel:(CasesIconItem *)model {
    _model = model;
    
    if (model.isdelete == NO) {
        self.DeleBut.hidden = YES;
        UIImage *image = [UIImage imageNamed:@"jiahao_s"];
        self.iconImageView.image = image;
        
    } else {
        self.DeleBut.hidden = NO;
        self.iconImageView.image = model.iconImage;
        
    }
    
}
- (void)deleButTap:(UIButton *)sender {
   
    if ([self.choosedelegate respondsToSelector:@selector(ChooseCollectionViewDelegate:)]) {
        [self.choosedelegate ChooseCollectionViewDelegate:self];
        
        
    }
        
        
}

@end
